package com.example.marketing.business;

public class User {


    private final String userId;
    private final String username;
    private final UserLevel userLevel;
    private int points;

    public User(String userId, String username, UserLevel userLevel, int initialPoints) {
        this.userId = userId;
        this.username = username;
        this.userLevel = userLevel;
        this.points = initialPoints;
    }

    public String getUserId() {
        return userId;
    }

    public String getUsername() {
        return username;
    }

    public UserLevel getUserLevel() {
        return userLevel;
    }

    public int getPoints() {
        return points;
    }

    public void addPoints(int points) {
        this.points += points;
    }

    public void grantCoupon(Coupon coupon) {
        // 实际应用中应该保存优惠券到用户账户
        System.out.println("用户 " + username + " 获得优惠券: " + coupon.getCouponName());
    }
}
